package com.hspedu.string;
//难
public class StringExercise10 {
    public static void main(String[] args) {
        Test1 ex = new Test1();
        ex.change(ex.str, ex.ch);
        System.out.print(ex.str + "and");
        System.out.println(ex.ch);
        //输出 hspandhava
    }
}

class Test1{
    final String str =new String("hsp");
    final char[] ch = {'j', 'a', 'v', 'a'};

    public void change(String str, char ch[]){
        /**
         * 这里的str是形参str,不是属性str ,
         * 如果写的是 this.str = "java"; 就能把属性给修改了
         */
        str = "java";
        ch[0] = 'h';//为什么能修改属性里的ch[]呢
    }
}